<?php
/**
 * @version		$Id: banner.php 10878 2008-08-30 17:29:13Z willebil $
 * @package		Joomla
 * @subpackage	Banners
 * @copyright	Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
 * @license		GNU/GPL, see LICENSE.php
 * Joomla! is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * See COPYRIGHT.php for copyright notices and details.
 */

// no direct access
defined ( '_JEXEC' ) or die ( 'Restricted access' );
jimport ( 'joomla.application.component.controller' );

class ManagerControllerconfig extends JController {

	var $urldirect  = "";
	var $mainframe = "";
	
    function __construct() {
        parent::__construct ();
        
        $this->view = &	$this->getView( 'config', 'html' );
        $this->urldirect = 'index.php?option=com_manager&c=config';
        $this->mainframe = JFactory::getApplication();
    }

    function display() {
        $this->view->display();
    }
    
	function add() {
		ManagerHelper::showToolBarForm('Add Config Site');
		$this->view->addForm();
	}
	
	function edit() {	
		ManagerHelper::showToolBarForm('Edit Config Site');
		$this->view->addForm();
	}
	
	function delete() {
		$row = & JTable::getInstance('Config', 'Table');
		
		$cid = JRequest::getVar('cid');
		if(!empty($cid)) {
			$row->deleteAll($cid);
		}

		$this->mainframe->redirect($this->urldirect);
	}
	
	function save() {
		$row = & JTable::getInstance( 'Config', 'Table' );
		$row->save($_POST);
		
		$this->mainframe->redirect($this->urldirect);
	}        
}

?>